---1. Check exist database
if exists (select * from sys.databases where name='KBCQuiz')
drop database KBCQuiz
go
---2. Create database
create database KBCQuiz

---3. Use database
use KBCQuiz
go
-------------------4. Create table Admin------------------------------
-- check exist table
If  exists (select * from sys.tables where name='Admin')
select * from Admin
go
create table Admin
(
	UserName nvarchar(100)not null,
	[PassWord] nvarchar(100)not null,
	FullName nvarchar(100) not null,
	DateOfBirth datetime not null,
	Email nvarchar(50) not null,
)

go
-------------------5. Create table Player----------------------------------
-- check exist table
If  exists (select * from sys.tables where name='Player')
drop table Player
go
create table Player
(
	Id int primary key identity(1,1),
	UserName nvarchar(100) not null,
	Email nvarchar(100) not null,
	DateOfBirth datetime not null,	
	[Address] nvarchar(100) not null,
	[Money] int null
)
go

--------------------6. Create table Question----------------------------------
-- check exist table
If  exists (select * from sys.tables where name='Question')
drop table Question
go
create table Question
(
	Id int primary key identity(1,1),
	[Content] nvarchar(100) not null,
	AnswerA nvarchar(100) not null,
	AnswerB nvarchar(100) not null,
	AnswerC nvarchar(100) not null,
	AnswerD nvarchar(100) not null,
	CorrectAnswer nvarchar(100) not null,
)
